/*  1:   */ package org.jetbrains.jps.model.impl;
/*  2:   */ 
/*  3:   */

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.model.*;
import org.jetbrains.jps.model.ex.JpsElementChildRoleBase;

import java.util.Map;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */
/* 12:   */
/* 13:   */
/* 14:   */
/* 15:   */ 
/* 16:   */ public class JpsEncodingConfigurationServiceImpl
/* 17:   */   extends JpsEncodingConfigurationService
/* 18:   */ {
/* 19:29 */   private static final JpsElementChildRoleBase<JpsSimpleElement<String>> a = JpsElementChildRoleBase.create("encoding");
/* 20:   */   
/* 21:   */   @Nullable
/* 22:   */   public String getGlobalEncoding(@NotNull JpsGlobal paramJpsGlobal)
/* 23:   */   {
/* 24:34 */     if (paramJpsGlobal == null) {
/* 25:34 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/impl/JpsEncodingConfigurationServiceImpl", "getGlobalEncoding" }));
/* 26:   */     }
/* 27:34 */     JpsSimpleElement localJpsSimpleElement = (JpsSimpleElement)paramJpsGlobal.getContainer().getChild(a);
/* 28:35 */     return localJpsSimpleElement != null ? (String)localJpsSimpleElement.getData() : null;
/* 29:   */   }
/* 30:   */   
/* 31:   */   public void setGlobalEncoding(@NotNull JpsGlobal paramJpsGlobal, @Nullable String paramString)
/* 32:   */   {
/* 33:40 */     if (paramJpsGlobal == null) {
/* 34:40 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/impl/JpsEncodingConfigurationServiceImpl", "setGlobalEncoding" }));
/* 35:   */     }
/* 36:40 */     if (paramString != null) {
/* 37:41 */       paramJpsGlobal.getContainer().setChild(a, JpsElementFactory.getInstance().createSimpleElement(paramString));
/* 38:   */     } else {
/* 39:44 */       paramJpsGlobal.getContainer().removeChild(a);
/* 40:   */     }
/* 41:   */   }
/* 42:   */   
/* 43:   */   @Nullable
/* 44:   */   public String getProjectEncoding(@NotNull JpsModel paramJpsModel)
/* 45:   */   {
/* 46:51 */     if (paramJpsModel == null) {
/* 47:51 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/impl/JpsEncodingConfigurationServiceImpl", "getProjectEncoding" }));
/* 48:   */     }
/* 49:51 */     JpsEncodingProjectConfiguration localJpsEncodingProjectConfiguration = getEncodingConfiguration(paramJpsModel.getProject());
/* 50:52 */     if (localJpsEncodingProjectConfiguration != null)
/* 51:   */     {
/* 52:53 */       String str = localJpsEncodingProjectConfiguration.getProjectEncoding();
/* 53:54 */       if (str != null) {
/* 54:55 */         return str;
/* 55:   */       }
/* 56:   */     }
/* 57:58 */     return getGlobalEncoding(paramJpsModel.getGlobal());
/* 58:   */   }
/* 59:   */   
/* 60:   */   @Nullable
/* 61:   */   public JpsEncodingProjectConfiguration getEncodingConfiguration(@NotNull JpsProject paramJpsProject)
/* 62:   */   {
/* 63:64 */     if (paramJpsProject == null) {
/* 64:64 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/impl/JpsEncodingConfigurationServiceImpl", "getEncodingConfiguration" }));
/* 65:   */     }
/* 66:64 */     return (JpsEncodingProjectConfiguration)paramJpsProject.getContainer().getChild(JpsEncodingProjectConfigurationImpl.ROLE);
/* 67:   */   }
/* 68:   */   
/* 69:   */   @NotNull
/* 70:   */   public JpsEncodingProjectConfiguration setEncodingConfiguration(@NotNull JpsProject paramJpsProject, @Nullable String paramString, @NotNull Map<String, String> paramMap)
/* 71:   */   {
/* 72:72 */     if (paramJpsProject == null) {
/* 73:72 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/impl/JpsEncodingConfigurationServiceImpl", "setEncodingConfiguration" }));
/* 74:   */     }
/* 75:72 */     if (paramMap == null) {
/* 76:72 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "2", "org/jetbrains/jps/model/impl/JpsEncodingConfigurationServiceImpl", "setEncodingConfiguration" }));
/* 77:   */     }
/* 78:72 */     JpsEncodingProjectConfigurationImpl localJpsEncodingProjectConfigurationImpl = new JpsEncodingProjectConfigurationImpl(paramMap, paramString); JpsEncodingProjectConfiguration 
/* 79:73 */       tmp110_107 = ((JpsEncodingProjectConfiguration)paramJpsProject.getContainer().setChild(JpsEncodingProjectConfigurationImpl.ROLE, localJpsEncodingProjectConfigurationImpl));
/* 80:73 */     if (tmp110_107 == null) {
/* 81:73 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/impl/JpsEncodingConfigurationServiceImpl", "setEncodingConfiguration" }));
/* 82:   */     }
/* 83:73 */     return tmp110_107;
/* 84:   */   }
/* 85:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.impl.JpsEncodingConfigurationServiceImpl

 * JD-Core Version:    0.7.0.1

 */